function orderlist(orderby, bywhich) {
    x = window.location.href;
    opos = x.search('orderby');
    if (opos<0)
        if (x.indexOf('?')<0)
            y=x+"?orderby="+orderby+"&bywhich="+bywhich;
        else
        if (x.indexOf('#')>0)
            y=x.replace('#',"&orderby="+orderby+"&bywhich="+bywhich);
        else
            y=x.substring()+"&orderby="+orderby+"&bywhich="+bywhich;
    else {
        bpos = x.search('bywhich');
        if (opos > bpos) {
            t=opos;
            opos=bpos;
            bpos=t;
        }
        y1=x.substring(0,opos);
        for (i=opos;i<=x.length;++i)
            if  (x.charAt(i)=='&') break;
        y2=x.substring(opos,i);
        y3=x.substring(i+1,bpos);
        for (i=bpos;i<=x.length;++i)
            if  (x.charAt(i)=='&') break;
        y4=x.substring(bpos,i);
        y5=x.substring(i,x.length);
        y=y1+"orderby="+orderby+y3+"&bywhich="+bywhich+y5;
    }
    window.location.assign(y);
}